//
//  BaseCollectionViewCell.m
//  WIFI
//
//  Created by linnzh on 2023/3/27.
//

#import "BaseCollectionViewCell.h"

@implementation BaseCollectionViewCell

+ (CGSize)cellSize {
    return CGSizeZero;
}

+ (NSValue *)cellSizeValue {
    return [NSValue valueWithCGSize:[self cellSize]];
}

+ (NSString *)cellIdentifier {
    return [NSString stringWithFormat:@"%@", [self class]];
}

+ (void)registerCellInCollectionView:(UICollectionView *)collectionView {
    [collectionView registerClass:[self class] forCellWithReuseIdentifier:[self cellIdentifier]];
}

+ (instancetype)cellWithIndexPath:(NSIndexPath *)indexPath atCollectionView:(UICollectionView *)collectionView {
    return [collectionView dequeueReusableCellWithReuseIdentifier:[self cellIdentifier] forIndexPath:indexPath];
}

- (instancetype)init {
    if (self = [super init]) {
        [self setupCell];
        [self setupSubviews];
    }
    return self;
}

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self setupCell];
        [self setupSubviews];
    }
    return self;
}

- (void)setupCell {
    for (UIView *view in self.subviews) {
        if([view isKindOfClass:[UIScrollView class]]) {
            ((UIScrollView *)view).delaysContentTouches = NO; // Remove touch delay for iOS 7
            break;
        }
    }
    self.backgroundView.backgroundColor = [UIColor clearColor];
    self.contentView.backgroundColor = [UIColor clearColor];
    self.backgroundColor = [UIColor clearColor];
}

- (void)setupSubviews {
    
}


@end
